package com.inmobi.androidsdk.bootstrapper;

import android.content.Context;
import com.inmobi.commons.cache.CacheController;
import com.inmobi.commons.cache.CacheController.Validator;
import com.inmobi.commons.cache.ProductConfig;
import com.inmobi.commons.internal.CommonsException;
import com.inmobi.commons.uid.UIDUtil;
import java.util.HashMap;
import java.util.Map;
import org.json.JSONObject;

public class Initializer
{
  public static final String PRODUCT_ADNETWORK = "adNetwork";
  private static Context a = null;
  private static JSONObject b = null;
  private static Map<String, String> c = new HashMap();
  private static ConfigParams d = new ConfigParams();
  private static CacheController.Validator e = new a();

  private static void a(Context paramContext)
  {
    if ((paramContext != null) && (a == null))
      if (a == null);
    while ((a != null) || (paramContext != null))
    {
      return;
      a = paramContext.getApplicationContext();
      c = getUidMap(paramContext);
      try
      {
        b(CacheController.getConfig("adNetwork", paramContext, c, e).getData());
        return;
      }
      catch (CommonsException localCommonsException)
      {
        return;
      }
    }
    throw new NullPointerException();
  }

  // ERROR //
  private static String b(String paramString)
  {
    // Byte code:
    //   0: getstatic 23	com/inmobi/androidsdk/bootstrapper/Initializer:a	Landroid/content/Context;
    //   3: invokestatic 59	com/inmobi/androidsdk/bootstrapper/Initializer:getUidMap	(Landroid/content/Context;)Ljava/util/Map;
    //   6: putstatic 32	com/inmobi/androidsdk/bootstrapper/Initializer:c	Ljava/util/Map;
    //   9: new 80	org/json/JSONObject
    //   12: dup
    //   13: aload_0
    //   14: invokespecial 83	org/json/JSONObject:<init>	(Ljava/lang/String;)V
    //   17: astore_1
    //   18: aload_1
    //   19: ldc 85
    //   21: invokevirtual 89	org/json/JSONObject:getJSONObject	(Ljava/lang/String;)Lorg/json/JSONObject;
    //   24: astore 11
    //   26: aload 11
    //   28: astore 4
    //   30: aload_1
    //   31: ldc 91
    //   33: invokevirtual 89	org/json/JSONObject:getJSONObject	(Ljava/lang/String;)Lorg/json/JSONObject;
    //   36: astore 10
    //   38: aload 10
    //   40: astore 6
    //   42: aload 6
    //   44: aload 4
    //   46: iconst_1
    //   47: invokestatic 97	com/inmobi/commons/internal/InternalSDKUtil:populateToNewJSON	(Lorg/json/JSONObject;Lorg/json/JSONObject;Z)Lorg/json/JSONObject;
    //   50: putstatic 25	com/inmobi/androidsdk/bootstrapper/Initializer:b	Lorg/json/JSONObject;
    //   53: getstatic 37	com/inmobi/androidsdk/bootstrapper/Initializer:d	Lcom/inmobi/androidsdk/bootstrapper/ConfigParams;
    //   56: getstatic 25	com/inmobi/androidsdk/bootstrapper/Initializer:b	Lorg/json/JSONObject;
    //   59: invokevirtual 101	com/inmobi/androidsdk/bootstrapper/ConfigParams:setFromJSON	(Lorg/json/JSONObject;)V
    //   62: aload_1
    //   63: ldc 91
    //   65: getstatic 37	com/inmobi/androidsdk/bootstrapper/Initializer:d	Lcom/inmobi/androidsdk/bootstrapper/ConfigParams;
    //   68: invokevirtual 105	com/inmobi/androidsdk/bootstrapper/ConfigParams:toJSON	()Lorg/json/JSONObject;
    //   71: invokevirtual 109	org/json/JSONObject:put	(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    //   74: pop
    //   75: aload_1
    //   76: invokevirtual 112	org/json/JSONObject:toString	()Ljava/lang/String;
    //   79: astore 9
    //   81: aload 9
    //   83: areturn
    //   84: astore_2
    //   85: new 80	org/json/JSONObject
    //   88: dup
    //   89: invokespecial 113	org/json/JSONObject:<init>	()V
    //   92: astore 4
    //   94: goto -64 -> 30
    //   97: astore 5
    //   99: new 80	org/json/JSONObject
    //   102: dup
    //   103: invokespecial 113	org/json/JSONObject:<init>	()V
    //   106: astore 6
    //   108: goto -66 -> 42
    //   111: astore_3
    //   112: ldc 115
    //   114: ldc 117
    //   116: aload_3
    //   117: invokestatic 123	com/inmobi/commons/internal/Log:debug	(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
    //   120: aconst_null
    //   121: areturn
    //   122: astore 7
    //   124: goto -4 -> 120
    //
    // Exception table:
    //   from	to	target	type
    //   18	26	84	java/lang/Exception
    //   30	38	97	java/lang/Exception
    //   9	18	111	java/lang/Exception
    //   42	62	111	java/lang/Exception
    //   62	81	111	java/lang/Exception
    //   85	94	111	java/lang/Exception
    //   99	108	111	java/lang/Exception
    //   62	81	122	org/json/JSONException
  }

  private static void b(Context paramContext)
  {
    a(paramContext);
    try
    {
      CacheController.getConfig("adNetwork", paramContext, c, e);
      return;
    }
    catch (Exception localException)
    {
    }
  }

  public static ConfigParams getConfigParams(Context paramContext)
  {
    b(paramContext);
    return d;
  }

  public static Map<String, String> getUidMap(Context paramContext)
  {
    return UIDUtil.getMap(a, d.getUID());
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.inmobi.androidsdk.bootstrapper.Initializer
 * JD-Core Version:    0.6.2
 */